We are migrating the bug tracker to github Issues. This is now the preferred way to report NASM bugs.

Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)

Bug 3392964 - -f obj directive uppercase also allcapses text records like THEADR and COMENT
Summary: -f obj directive uppercase also allcapses text records like THEADR and COMENT
Status: OPEN
Alias: None
Product: NASM
Classification: Unclassified
Component: Assembler (show other bugs)
Version: 3.01 (development)
Hardware: All All
: Medium minor
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2025-10-09 04:56 PDT by E. C. Masloch
Modified: 2025-10-09 04:56 PDT (History)
4 users (show)

Obtained from: Built from git using configure
Generated by: Human
Bug category: Other, Unexpected or confusing behavior
Observed for: Production code
Regression: No
Regression since:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description E. C. Masloch 2025-10-09 04:56:26 PDT
From the documentation: https://nasm.us/docs/3.01rc7/nasm09.html#section-9.4.3

> The UPPERCASE format-specific directive causes all segment, group and symbol names that are written to the object file to be forced to upper case just before being written. Within a source file, NASM is still case-sensitive; but the object file can be written entirely in upper case if desired.

Relevant source text: https://github.com/netwide-assembler/nasm/blob/43f9a71fc080c9ed1306e58b48d3320739558a4c/output/outobj.c#L408

It isn't clear to me that the comment records like "Translator" and THEADR should also be allcapsed. I think at least an update to the documentation is in order to clarify this.

Minor nitpick:

> UPPERCASE is used alone on a line; it requires no parameters.

Looking at the source text it appears the directive actually allows a boolean keyword or numeric expression, albeit absent one it is taken to mean "true": https://github.com/netwide-assembler/nasm/blob/43f9a71fc080c9ed1306e58b48d3320739558a4c/asm/getbool.c#L25


Test case, using https://github.com/boeckmann/omfdump/

test$ cat test.asm
        nop
test$ ~/proj/nasmtest/rc/nasm -v
NASM version 3.01rc2 compiled on Oct  6 2025
test$ ~/proj/nasmtest/rc/nasm test.asm -fobj
test$ ~/proj/omfdump/omfdump test.obj
80 THEADR       10 bytes, checksum 3F (valid)
   0000: 08 74 65 73 74 2e 61 73-6d                       :  .test.asm
88 COMENT       33 bytes, checksum 82 (valid)
   [NP=0 NL=0 UD=00] 00 Translator
   0002: 1d 54 68 65 20 4e 65 74-77 69 64 65 20 41 73 73  :  .The Netwide Ass
   0012: 65 6d 62 6c 65 72 20 33-2e 30 31 72 63 32        :  embler 3.01rc2
96 LNAMES       15 bytes, checksum B4 (valid)
   [0001] ''
   0000: 00 0c 5f 5f 4e 41 53 4d-44 45 46 53 45 47        :  .
   [0002] '__NASMDEFSEG'
   0001: 0c 5f 5f 4e 41 53 4d 44-45 46 53 45 47           :  .__NASMDEFSEG
98 SEGDEF16      7 bytes, checksum 34 (valid)
     BYTE (A1) PUBLIC (C2) USE16 size 0001
     name '__NASMDEFSEG'
   0000: 28 01 00 02 01 01                                :  (.....
88 COMENT        4 bytes, checksum 91 (valid)
   [NP=0 NL=1 UD=00] A2 Link pass separator
   0002: 01                                               :  .
a0 LEDATA16      5 bytes, checksum CA (valid)
                segment '__NASMDEFSEG', offset 0000
   0000: 90                                               :  .
8a MODEND16      2 bytes, checksum 74 (valid)
   0000: 00                                               :  .
test$ ~/proj/nasmtest/rc/nasm test.asm -fobj --before uppercase
test$ ~/proj/omfdump/omfdump test.obj
80 THEADR       10 bytes, checksum 1F (valid)
   0000: 08 54 45 53 54 2e 41 53-4d                       :  .TEST.ASM
88 COMENT       33 bytes, checksum C2 (valid)
   [NP=0 NL=0 UD=00] 00 Translator
   0002: 1d 54 48 45 20 4e 45 54-57 49 44 45 20 41 53 53  :  .THE NETWIDE ASS
   0012: 45 4d 42 4c 45 52 20 33-2e 30 31 52 43 32        :  EMBLER 3.01RC2
96 LNAMES       15 bytes, checksum B4 (valid)
   [0001] ''
   0000: 00 0c 5f 5f 4e 41 53 4d-44 45 46 53 45 47        :  .
   [0002] '__NASMDEFSEG'
   0001: 0c 5f 5f 4e 41 53 4d 44-45 46 53 45 47           :  .__NASMDEFSEG
98 SEGDEF16      7 bytes, checksum 34 (valid)
     BYTE (A1) PUBLIC (C2) USE16 size 0001
     name '__NASMDEFSEG'
   0000: 28 01 00 02 01 01                                :  (.....
88 COMENT        4 bytes, checksum 91 (valid)
   [NP=0 NL=1 UD=00] A2 Link pass separator
   0002: 01                                               :  .
a0 LEDATA16      5 bytes, checksum CA (valid)
                segment '__NASMDEFSEG', offset 0000
   0000: 90                                               :  .
8a MODEND16      2 bytes, checksum 74 (valid)
   0000: 00                                               :  .
test$